package com.share.all.service;

import org.springframework.core.io.Resource;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @author caifan
 * created 2024/1/23 15:14
 */
public interface FileStorageService {


    /**
     * 上传文件
     * @param file 文件
     * @return
     * @throws IOException
     */
    String storeFile(MultipartFile file) throws IOException;

    /**
     * 下载文件
     * @param fileName
     * @return
     */
    Resource loadFileAsResource(String fileName) throws IOException;
}
